

#ifndef _POOLJOB_H_
#define _POOLJOB_H_	1

#include <Winsock.h>
#include "Communicator.h"
#include "httpcommon.h"

class CThreadPool;

/*
 * Abstract Class for Thread Job
 */
class CPoolJob
{
	friend class CThreadPool;
protected:
	unsigned virtual RunningJob() = 0;

};


typedef enum _PROXY_MEMBER { CLIENT, PROXY, SERVER } PROXY_MEMBER;

class CPoolJobHttpProxy : public CPoolJob
{
public:
	CPoolJobHttpProxy();			// Default Constructor
	CPoolJobHttpProxy(CPoolJobHttpProxy &);	// Copy Constructor

	// GET/SET Functions
	void			SetEngineData(ENGINE_DATA);
	ENGINE_DATA		GetEngineData();


private:
	unsigned virtual RunningJob();

	friend class CThreadPool;

public:

	// Operator Overloading
	//CPoolJobHttpProxy& operator =(const CPoolJobHttpProxy &job);
	CPoolJobHttpProxy& operator =(const CPoolJobHttpProxy &job);

private:
	
	ENGINE_DATA			m_enginedata;
};


/*
 *	FOR TEST
 */
class CPoolJobTest : public CPoolJob
{
public:
	// copy constructor
	CPoolJobTest() : m_clientSock(0) {}
	CPoolJobTest(CPoolJobTest &job);


	void	SetClientSock(SOCKET);

private:
	SOCKET	m_clientSock;

	unsigned virtual RunningJob();

	// Friend Class
	friend class CThreadPool;

public:
	// operator overloading
	CPoolJobTest& operator=(const CPoolJobTest &job);
};



#endif